/*
 * @Description: 元数据管理
 * @Author: Rfan
 * @Date: 2022-01-07 09:15:48
 * @LastEditTime: 2022-05-27 14:20:55
 */

import classNames from 'classnames/bind';
import { ArcTypeRouterTypeContext } from '@/view/system/ArcType/contexts/ArcTypeRouterTypeContext';
import { ArcTypeContextProvider } from './contexts/ArcTypeContext';
import ArcTypeWrap from './components/ArcTypeWrap';
import FondsSidebar from './components/FondsSidebar';
import Operate from './components/Operate';
import PageLayout from '@/layout/PageLayout';
import { EnumArcTypeRouteTypes } from '@/view/system/ArcType/dictionaries';
import styles from './styles/arcTypeMain.module.scss';

const cx = classNames.bind(styles);

interface ISystemArcTypeProps {
  routerType?: EnumArcTypeRouteTypes;
}

export const SystemArcTypePage = (props: ISystemArcTypeProps) => {
  const { routerType = EnumArcTypeRouteTypes.Normal } = props;

  return (
    <ArcTypeRouterTypeContext.Provider value={{ routerType }}>
      <ArcTypeContextProvider>
        <PageLayout className={cx('arc-type-wrap')} sidebar={<FondsSidebar />} title={<Operate />}>
          <ArcTypeWrap />
        </PageLayout>
      </ArcTypeContextProvider>
    </ArcTypeRouterTypeContext.Provider>
  );
};

const SystemArcType = () => <SystemArcTypePage />;

export default SystemArcType;
